//
//  AEHistoryPointsViewCell.m
//  AESOLAR_IOS
//
//  Created by Bin Tang on 2024/10/15.
//  Copyright © 2024 Mr.Wang. All rights reserved.
//

#import "AEHistoryPointsViewCell.h"
#import "AE_Solar-Swift.h"

@interface AEHistoryPointsViewCell ()

@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UILabel *createTimeLabel;

@property (nonatomic, strong) UILabel *remarkLabel;


- (void)initWithTitleLabel;

- (void)initWithCreateTimeLabel;

- (void)initWithRemarkLabel;

@end

@implementation AEHistoryPointsViewCell

- (void)initWithSubViewCell {
    [super initWithSubViewCell];
    
    self.contentView.backgroundColor = kWhiteColor;
}

- (void)initWithTitleLabel {
    if (!_titleLabel) {
        CGRect frame = CGRectMake(15, 15, kScreenW - 30, 22);
        UIFont *font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
        _titleLabel = [UILabel createWithLabel:self.contentView frame:frame font:font propertiesBlock:^(UILabel * _Nonnull label) {
            label.textColor = [UIColor colorWithHexString:@"#333333"];
        }];
    }
    NSString *tmpStr = [AEStringExten localizedValueWithKey:@"获得"];
    NSString *cnt = [AEStringExten localizedValueWithKey:@"积分"];
    NSString *title = [NSString stringWithFormat:@"%@ -%@%@", tmpStr, @"23", cnt];
    self.titleLabel.text = title;
}

- (void)initWithCreateTimeLabel {
    if (!_createTimeLabel) {
        CGRect frame = CGRectMake(15, self.titleLabel.bottom + 6, self.titleLabel.width, 18);
        UIFont *font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
        _createTimeLabel = [UILabel createWithLabel:self.contentView frame:frame font:font propertiesBlock:^(UILabel * _Nonnull label) {
            label.textColor = [UIColor colorWithHexString:@"#999999"];
        }];
    }
    self.createTimeLabel.text = @"2024-10-12 23:32:23";
}

- (void)initWithRemarkLabel {
    if (!_remarkLabel) {
        CGRect frame = self.createTimeLabel.frame;
        frame.origin.y = self.createTimeLabel.bottom + 6;
        UIFont *font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
        _remarkLabel = [UILabel createWithLabel:self.contentView frame:frame font:font propertiesBlock:^(UILabel * _Nonnull label) {
            label.textColor = [UIColor colorWithHexString:@"#999999"];
        }];
    }
    _remarkLabel.text = @"积分兑换";
}


- (void)updateCellData:(id)cellEntity {
    
    [self initWithTitleLabel];

    [self initWithCreateTimeLabel];

    [self initWithRemarkLabel];

}

@end
